"use strict";
class Person {
    constructor(name, age, sex) {
        // 类的成员变量（属性），可以给默认值
        this.sex = "男";
        this.name = name;
        this.age = age;
        if (sex) {
            this.sex = sex;
        }
    }
    sayHello() {
        console.log(this.name + "，向大家问好！");
    }
}
// 创建类的示例
let lbj = new Person("罗佰君", 26, "男");
let fx = new Person("奉先", 35);
console.log(lbj);
console.log(fx);
lbj.sayHello();
fx.sayHello();
